<div class="main">
  <div class="main-header">
    <div class="pa-icon-div pull-left fs-14">
      <i class="iconfont icon-shouye fs-14 icon-vertical-top"></i>
      <span class="fs-vertical-middle">工作台>人员管理>
        <span class="fs-theme-color">人员登记</span>
      </span>
    </div>
    <go-back></go-back>
  </div>
  <div class="main-content add-worker-content">
    <form class="base-info add-worker-info add-worker-component"
      name="workers" role="form" novalidate>
      <div class="container-header fs-16">
        <span>人员登记流程</span>
      </div>
      <div class="steps">
        <ul>
          <li class="nav-list fl"
            ng-repeat="nav in vm.navData"
            ng-class="{'active': vm.currentIndex == $index, 'is-transparency': nav.isTransparency}"
            ng-click="vm.$isToggle(nav, $index)">
            <a class="nav-item"><span>{{nav.id}}.</span><span>{{nav.name}}</span></a>
          </li>
        </ul>
      </div>
      <div class="add-content">
        <div ng-show="vm.currentIndex == 0">
          <section>
            <div class="info-item-header">
              <label class="info-item-header-label">采集信息</label>
            </div>
            <div>
              <label class="theme-info fs-theme-color">身份证信息</label>
              <div class="second-base-info">
                <div class="w-80 fl fs0">
                  <div class="pa-form-control">
                    <label class="pa-base-info-label fs-theme-color">姓名：</label>
                    <span class="pa-base-info-fr">{{vm.workerInfo.idCardBean.name}}</span>
                  </div>
                  <div class="pa-form-control">
                    <label class="pa-base-info-label fs-theme-color">民族：</label>
                    <span class="pa-base-info-fr">{{vm.workerInfo.idCardBean.nation}}</span>
                  </div>
                  <div class="pa-form-control">
                    <label class="pa-base-info-label fs-theme-color">性别：</label>
                    <span class="pa-base-info-fr">
                      {{vm.workerInfo.idCardBean.sex == 1 ? '男' : vm.workerInfo.idCardBean.sex == 2 ? '女' : ''}}
                    </span>
                  </div>
                  <div class="pa-form-control">
                    <label class="pa-base-info-label fs-theme-color">出生日期：</label>
                    <span class="pa-base-info-fr">{{vm.workerInfo.idCardBean.birthday | date:"yyyy-MM-dd"}}</span>
                  </div>
                  <div class="pa-form-control">
                    <label class="pa-base-info-label fs-theme-color">住址：</label>
                    <span class="pa-base-info-fr" style="width: 285px;">{{vm.workerInfo.idCardBean.address}}</span>
                  </div>
                  <div class="pa-form-control">
                    <label class="pa-base-info-label fs-theme-color">身份证号：</label>
                    <span class="pa-base-info-fr">{{vm.workerInfo.idCardBean.idNo}}</span>
                  </div>
                </div>
                <div class="w-20 fr img-box">
                  <img class="avatar" ng-src="{{vm.$getAvatarSrc()}}" alt="">
                </div>
              </div>
            </div>
            <div class="clearfix">
              <label class="theme-info fs-theme-color">指纹信息</label>
              <div class="second-base-info">
                <div class="pa-form-control">
                  <span class="span-padding">已采集</span>
                </div>
              </div>
            </div>
            <div>
              <label class="theme-info fs-theme-color">智能卡信息</label>
              <div class="second-base-info">
                <div class="pa-form-control">
                  <span class="span-padding">已关联（{{vm.workerInfo.rfidNo}}）</span>
                </div>
              </div>
            </div>
          </section>
        </div>
        <div class="date-none-border" ng-show="vm.currentIndex == 1">
          <section>
            <div class="info-item-header">
              <label class="info-item-header-label">基本信息</label>
            </div>
            <div class="second-base-info base-info-w50">
              <div class="pa-form-control w-55">
                <label class="pa-base-info-label fs-theme-color"><b>*</b>人员种类：</label>
                <select class="form-control-select"
                  name="type"
                  ng-options="worker.value as worker.name for worker in workerTypeParams"
                  ng-model="vm.orgPersonBean.type"
                  >
                  <option value=""></option>
                </select>
                <span class="mandatory fs-12"
                  ng-show="(workers.$submitted || workers.type.$dirty) && workers.type.$error.required">
                  必填
                </span>
              </div>
              <div class="pa-form-control w-45">
                <label class="pa-base-info-label fs-theme-color">学历：</label>
                <select class="form-control-select"
                  ng-options="degree.value as degree.name for degree in degreeParams"
                  ng-model="vm.orgPersonBean.degree">
                  <option value=""></option>
                </select>
              </div>
              <div class="pa-form-control w-55">
                <label class="pa-base-info-label fs-theme-color"><b>*</b>籍贯：</label>
                <span class="cascader-picker" style="width: 309px;">
                  <input type="text"
                    name="nativePlace"
                    style="width: 309px;" readonly
                    class="form-control-input"
                    ng-model="vm.orgPersonBean.nativePlace"
                    ng-click="vm.isCasaderExpanded = !vm.isCasaderExpanded"
                    >
                  <i class="icon iconfont icon-xiala" ng-class="{'arrow-expand': vm.isCasaderExpanded}"></i>
                  <div class="casader-menus" ng-show="vm.isCasaderExpanded">
                    <ul class="casader-menu">
                      <li class="casader-menu-item"
                        ng-repeat="item in vm.casaderData"
                        ng-click="vm.activeItem1 = item;">{{item.name}}</li>
                    </ul>
                    <ul class="casader-menu">
                      <li class="casader-menu-item"
                        ng-repeat="item in vm.activeItem1.sub"
                        ng-click="vm.casaderPick(vm.activeItem1, item)">{{item.name}}</li>
                    </ul>
                  </div>
                </span>
                <span class="mandatory fs-12"
                  ng-show="(workers.$submitted || workers.nativePlace.$dirty) && workers.nativePlace.$error.required">
                  必填
                </span>
              </div>
              <div class="pa-form-control w-45">
                <label class="pa-base-info-label fs-theme-color"><b>*</b>联系方式：</label>
                <input type="text" class="form-control-input"
                  name="cellphone"
                  ng-model="vm.orgPersonBean.cellphone">
                <span class="mandatory fs-12"
                  ng-show="(workers.$submitted || workers.cellphone.$dirty) && workers.cellphone.$error.required">
                  必填
                </span>
              </div>
              <div class="pa-form-control w-55">
                <label class="pa-base-info-label fs-theme-color"><b>*</b>部门：</label>
                <!-- <select class="form-control-select"
                  name="department"
                  ng-options="dept as dept.name for dept in deptParams"
                  ng-model="vm.department"
                  ng-change="vm.$isChangeSelect(positionParams)">
                  <option value="{{dept.code}}"
                    ng-selected="vm.workerInfo.departmentCode === dept.code">{{dept.code}}{{dept.name}}</option>
                </select> -->
                <select class="form-control-select"
                  name="department"
                  ng-model="vm.department"
                  ng-change="vm.$isChangeSelect(positionParams)">
                  <option
                    ng-repeat="dept in deptParams"
                    ng-selected="vm.workerInfo.departmentCode === dept.code"
                    value="{{dept}}">{{dept.name}}</option>
                </select>
                <span class="mandatory fs-12"
                  ng-show="(workers.$submitted || workers.department.$dirty) && workers.department.$error.required">
                  必填
                </span>
              </div>
              <div class="pa-form-control w-45">
                <label class="pa-base-info-label fs-theme-color"><b>*</b>进场时间：</label>
                <input type="text"
                  name="inTime"
                  class="form-control-input date-picker add-worker-time-input"
                  data-ng-datepicker
                  ng-model="vm.orgPersonBean.inTime">
                <span class="mandatory fs-12"
                  ng-show="(workers.$submitted || workers.inTime.$dirty) && workers.inTime.$error.required">
                  必填
                </span>
              </div>
              <div class="pa-form-control w-100">
                <label class="pa-base-info-label fs-theme-color"><b>*</b>岗位：</label>
                <select class="form-control-select"
                  ng-options="post.code as post.name for post in vm.positionParams"
                  ng-model="vm.orgPersonBean.postCode">
                  <option value="{{post.code}}">{{post.name}}</option>
                </select>
              </div>
              <div class="pa-form-control w-100">
                <label class="pa-base-info-label fs-theme-color">备注：</label>
                <input type="text" class="form-control-input form-control-note"
                  ng-model="vm.orgPersonBean.remark">
              </div>
            </div>
          </section>
        </div>
        <div class="date-none-border" ng-show="vm.currentIndex == 2">
          <section>
            <div class="info-item info-table clearfix">
              <div class="info-item-header fs-14">
                <label class="info-item-header-label">证书信息</label>
                <div class="pa-operate-add fr fs-14 fs-theme-color" ng-click="vm.$addCertify()">
                  <a class="pa-btn-a">
                    <i class="iconfont icon-add fs-14"></i>
                    <span>新增</span>
                  </a>
                </div>
              </div>
              <table class="add-table fs-14">
                <thead>
                  <tr>
                    <th>证书名称</th>
                    <th>证书编号</th>
                    <th>发证单位</th>
                    <th>发证时间</th>
                    <th>有效日期</th>
                    <th class="operate-w20"></th>
                  </tr>
                </thead>
                <tbody>
                  <tr ng-repeat="item in vm.certificateList">
                    <!-- <td ng-hide="vm.orgPersonBean.type == 1">
                      <select class="form-control-select"
                        ng-show="vm.isSpecial"
                        ng-model="item.type">
                        <option value="4">特种作业证</option>
                      </select>
                      <select class="form-control-select"
                        ng-show="vm.isThree"
                        ng-model="item.type">
                        <option value="1">A证</option>
                        <option value="2">B证</option>
                        <option value="3">C证</option>
                      </select>
                    </td> -->
                    <td>
                      <input type="text" class="form-control-input"
                        ng-model="item.type">
                    </td>
                    <td>
                      <input type="text" class="form-control-input"
                        ng-model="item.code">
                    </td>
                    <td>
                      <input type="text" class="form-control-input"
                        ng-model="item.issueUnit">
                    </td>
                    <td>
                      <input type="text" class="form-control-input date-picker"
                        data-ng-datepicker ng-model="item.issueDate">
                    </td>
                    <td>
                      <input type="text" class="form-control-input date-picker"
                        data-ng-datepicker ng-model="item.validPeriod">
                    </td>
                    <td ng-click="vm.$cancelCertify(item, $index)"><i class="fa fa-times-circle"></i></td>
                  </tr>
                </tbody>
              </table>
            </div>
          </section>
        </div>
        <div ng-show="vm.currentIndex == 3">
          <section>
            <div class="info-item clearfix">
              <div class="info-item-header fs-14">
                <label class="info-item-header-label">附件信息（简历/资料等附件）</label>
                <div class="pa-operate-add fr fs-14 fs-theme-color">
                  <a class="pa-btn-a"
                    attachment-uploader
                    data-url="/api/v1/common/uploadFile?folderName=staff"
                    data-target=".file-list"
                    ng-model="vm.view.files">
                    <i class="iconfont icon-add fs-14"></i>
                    <span>新增</span>
                  </a>
                </div>
              </div>
              <div class="file-list"></div>
            </div>
          </section>
        </div>
      </div>
      <div class="action fr">
        <ul>
          <li class="fl">
            <button class="steps-btn"
              ng-class="{'disabled-active': vm.currentIndex == 0, 'active': vm.currentIndex != 0}"
              ng-disabled='vm.currentIndex == 0'
              ng-click="vm.$toggleNav(1)">上一步</button>
          </li>
          <li class="fl">
            <button class="steps-btn"
              ng-class="{'active': vm.currentIndex != 3}"
                         ng-hide="vm.currentIndex == 3"
                         ng-click="vm.$toggleNav(2, workers)">下一步</button>
          </li>
          <li class="fl">
            <button class="steps-btn"
              ng-class="{'active': vm.currentIndex == 3}"
                         ng-show="vm.currentIndex == 3"
                         ng-click="vm.$finish(worker)">完成</button>
          </li>
        </ul>
      </div>
    </form>
  </div>
</div>